package com.xs.store.user.controller;

import com.xs.store.user.pojo.User;
import com.xs.store.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @PostMapping("/login")
    public String login(@RequestBody User user){
        return userService.login(user);
    }


    @GetMapping("/list")
    public List<User> list(){
        return userService.list();
    }

}
